<template>
    <example :template-code="templateString">
        <template #describe>
            <t :id="`${$t('基础示例')}`">{{ $t('基础示例') }}</t>
        </template>
        <div style="width: 300px;">
            <sib-item v-model="value" :props="props" @change="change"></sib-item>
        </div>
    </example>
</template>

<script>
import { ref, reactive } from 'vue';

export default {
    setup() {
        const value = ref('蒹葭苍苍，白露为霜');
        const props = reactive({
            type: 'text',
            maxlength: 10,
            showWordLimit: true,
        });
        const change = (data) => {
            console.log('data: ', data);
        };

        return {
            props,
            value,
            change,
            templateString: `<template>
    <sib-item v-model="value" :props="props" @change="change"></sib-item>
</template>

<script>
import { ref, reactive } from 'vue';

export default {
    setup() {
        const value = ref('蒹葭苍苍，白露为霜');
        const props = reactive({
            type: 'text',
            maxlength: 10,
            showWordLimit: true,
        });
        const change = (data) => {
            console.log('data: ', data);
        };

        return { props, value, change };
    },
};
<\/script>`,
        };
    },
};
</script>
